<!DOCTYPE html>
<html lang="zh" dir="ltr">
<head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="了解神马中转API的使用方法，掌握如何配置和调用中转API服务，轻松解决接口调用难题。">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#343a40">
<meta name="color-scheme" content="light dark"><meta property="og:url" content="http://localhost:1313/docs/openai/gptwst/">
  <meta property="og:site_name" content="神马中转API_低价稳定中转API推荐">
  <meta property="og:title" content="gpt文生图">
  <meta property="og:description" content="了解神马中转API的使用方法，掌握如何配置和调用中转API服务，轻松解决接口调用难题。">
  <meta property="og:locale" content="zh">
  <meta property="og:type" content="article">
    <meta property="article:section" content="docs">
    <meta property="article:modified_time" content="2025-09-21T00:12:32+08:00">
    <meta property="article:tag" content="API">
    <meta property="article:tag" content="中转API">
    <meta property="article:tag" content="服务使用">
<title>gpt文生图 | 神马中转API_低价稳定中转API推荐</title>
<link rel="icon" href="/favicon.png" >
<link rel="manifest" href="/manifest.json">
<link rel="canonical" href="http://localhost:1313/docs/openai/gptwst/">
<link rel="stylesheet" href="/book.min.ce1689397c669bcad456856a83f58cfccb0f8b23e5dd2bbff3755c795c7c8e70.css" integrity="sha256-zhaJOXxmm8rUVoVqg/WM/MsPiyPl3Su/83VceVx8jnA=" crossorigin="anonymous">
  <script defer src="/fuse.min.js"></script>
  <script defer src="/zh.search.min.e0e482070ec6d6d785985b436113219157ff4e98f68389abe3e06a9d7752fafd.js" integrity="sha256-4OSCBw7G1teFmFtDYRMhkVf/Tpj2g4mr4&#43;BqnXdS&#43;v0=" crossorigin="anonymous"></script>

  <script defer src="/sw.min.6f6f90fcb8eb1c49ec389838e6b801d0de19430b8e516902f8d75c3c8bd98739.js" integrity="sha256-b2&#43;Q/LjrHEnsOJg45rgB0N4ZQwuOUWkC&#43;NdcPIvZhzk=" crossorigin="anonymous"></script>
<!--
Made with Book Theme
https://github.com/alex-shpak/hugo-book
-->
  
</head>
<body dir="ltr" class="book-kind-page book-type-docs book-layout-">
  <input type="checkbox" class="hidden toggle" id="menu-control" />
  <input type="checkbox" class="hidden toggle" id="toc-control" />
  <main class="container flex">
    
<aside class="book-menu">
  <div class="book-menu-content">
    
  <nav>
<h2 class="book-brand">
  <a class="flex align-center" href="/"><span>神马中转API_低价稳定中转API推荐</span>
  </a>
</h2>


<div class="book-search hidden">
  <input type="text" id="book-search-input" placeholder="搜索" aria-label="搜索" maxlength="64" data-hotkeys="s/" />
  <div class="book-search-spinner hidden"></div>
  <ul id="book-search-results"></ul>
</div>
<script>document.querySelector(".book-search").classList.remove("hidden")</script>















  
  <ul>
    
      
        <li>
          
  
  

  
    <a href="/docs/introduction/" class="">神马中转API一站式AI大模型API中转站 · 低价好用稳定的中转API服务</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <input type="checkbox" id="section-a1a75651f33f50151b1f3e0e2f525ee1" class="toggle"  />
    <label for="section-a1a75651f33f50151b1f3e0e2f525ee1" class="flex">
      <a role="button" class="flex-auto ">基础知识</a>
    </label>
  

          
  <ul>
    
      
        <li>
          
  
  

  
    <a href="/docs/aidocs/base/" class="">基本概念-令牌（Token）</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/aidocs/key/" class="">添加令牌：您的AI通行证指南</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/aidocs/api/" class="">基本概念-API地址（BaseURL）</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/aidocs/group/" class="">基本概念-令牌渠道分组</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/aidocs/pay1/" class="">基本概念-按量付费</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/aidocs/pay2/" class="">基本概念-按次付费</a>
  

        </li>
      
    
  </ul>

        </li>
      
    
      
        <li>
          
  
  

  
    <input type="checkbox" id="section-cd3c7c429af15477d4ff05ea111934a3" class="toggle"  />
    <label for="section-cd3c7c429af15477d4ff05ea111934a3" class="flex">
      <a role="button" class="flex-auto ">站内基础教程</a>
    </label>
  

          
  <ul>
    
      
        <li>
          
  
  

  
    <a href="/docs/ailearn/wallet/" class="">基础教程-钱包 · 页面</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/ailearn/model/" class="">基础教程-支持模型 · 页面</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/ailearn/chat/" class="">基础教程-聊天 · 页面</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/ailearn/dev/" class="">基础教程-开发者 · 快速接入</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/ailearn/sdk/" class="">高级功能-官方SDK支持</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/ailearn/notice/" class="">高级功能-通知设置 · 额度预警通知</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/ailearn/keysafety/" class="">高级功能-API KEY 安全配置</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/ailearn/errorcode/" class="">常见报错码</a>
  

        </li>
      
    
  </ul>

        </li>
      
    
      
        <li>
          
  
  

  
    <input type="checkbox" id="section-a2f7d319ec4c5bbb43978c97667e6cea" class="toggle" checked />
    <label for="section-a2f7d319ec4c5bbb43978c97667e6cea" class="flex">
      <a role="button" class="flex-auto ">Openai请求格式（通用）</a>
    </label>
  

          
  <ul>
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/syfw/" class="">适用范围：♥ 所有模型</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/ptdhfl/" class="">普通文本对话（非流）</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/ptdhls/" class="">普通文本对话（流式输出）</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/gdgshscjson/" class="">固定格式化输出Json</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/embedding/" class="">embedding代码例子</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/wltpjx/" class="">网络图片解析</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/bdtpjx/" class="">本地图片解析</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/functioncall/" class="">函数调用FunctionCall</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/whisper/" class="">whisper使用示例</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/gpttts/" class="">gpt-tts</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/gptwst/" class="active">gpt文生图</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/openai/gpttst/" class="">gpt图生图</a>
  

        </li>
      
    
  </ul>

        </li>
      
    
      
        <li>
          
  
  

  
    <input type="checkbox" id="section-0621f15f4cf04829ac2eddaaa730205e" class="toggle"  />
    <label for="section-0621f15f4cf04829ac2eddaaa730205e" class="flex">
      <a role="button" class="flex-auto ">模型接入教程</a>
    </label>
  

          
  <ul>
    
  </ul>

        </li>
      
    
      
        <li>
          
  
  

  
    <span>常见AI程序配置教程</span>
  

          
  <ul>
    
      
        <li>
          
  
  

  
    <input type="checkbox" id="section-5e705709838a94aa211a15f9c6e02e24" class="toggle"  />
    <label for="section-5e705709838a94aa211a15f9c6e02e24" class="flex">
      <a role="button" class="flex-auto ">编程工具类</a>
    </label>
  

          
  <ul>
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/devtools/claudecode/" class="">Claude code 配置方式</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/devtools/pythonopenai/" class="">python openai官方库（使用AutoGPT，langchain等）</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/devtools/codegpt/" class="">VSCode 插件 Code GPT 使用指南</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/devtools/easycode/" class="">JetBrains插件 Easycode ​</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/devtools/langchain/" class="">LangChain​</a>
  

        </li>
      
    
  </ul>

        </li>
      
    
      
        <li>
          
  
  

  
    <input type="checkbox" id="section-1d8817d18f5c961cd85158eff2d9c95e" class="toggle"  />
    <label for="section-1d8817d18f5c961cd85158eff2d9c95e" class="flex">
      <a role="button" class="flex-auto ">对话客户端类</a>
    </label>
  

          
  <ul>
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/chat/cherrystudio/" class="">Cherry Studio</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/chat/chatgptwebmidjourneyproxy/" class="">Chatgpt-web-midjourney-proxy</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/chat/lobechat/" class="">Lobe-Chat</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/chat/utools-chatgpt/" class="">utools-ChatGPT</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/chat/sidebar/" class="">浏览器插件 ChatGPT Sidebar</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/chat/chatbox/" class="">ChatBox(推荐使用)</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/chat/chatnextweb/" class="">Chat Next Web</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/chat/GoAmz/" class="">GoAmz</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/chat/SparkAI/" class="">SparkAI</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/chat/nineai/" class="">NineAI(99AI) </a>
  

        </li>
      
    
  </ul>

        </li>
      
    
      
        <li>
          
  
  

  
    <input type="checkbox" id="section-b333ba0fec99449c08fe8af0c1f5a49b" class="toggle"  />
    <label for="section-b333ba0fec99449c08fe8af0c1f5a49b" class="flex">
      <a role="button" class="flex-auto ">工具类</a>
    </label>
  

          
  <ul>
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/tools/raycast/" class="">Raycast 插件 ChatGPT 使用指南（推荐使用）</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/tools/dify/" class="">Dify</a>
  

        </li>
      
    
  </ul>

        </li>
      
    
      
        <li>
          
  
  

  
    <input type="checkbox" id="section-5852b31e2d938d5dbe93ddd86df36c0f" class="toggle"  />
    <label for="section-5852b31e2d938d5dbe93ddd86df36c0f" class="flex">
      <a role="button" class="flex-auto ">官方SDK类</a>
    </label>
  

          
  <ul>
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/sdk/openaisdk/" class="">OpenAI官方SDK</a>
  

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/otherai/sdk/geminisdk/" class="">Gemini SDK 配置</a>
  

        </li>
      
    
  </ul>

        </li>
      
    
  </ul>

        </li>
      
    
      
        <li>
          
  
  

  
    <a href="/docs/errorcode/" class="">常见错误以及解决办法</a>
  

        </li>
      
    
  </ul>










  
<ul>
  
  <li>
    
    <a href="https://whatai.cc"  target="_blank" rel="noopener">
        AI导航
      </a>
  </li>
  
  <li>
    
    <a href="https://api.whatai.cc"  target="_blank" rel="noopener">
        中转API官网
      </a>
  </li>
  
</ul>






</nav>




  <script>(function(){var e=document.querySelector("aside .book-menu-content");addEventListener("beforeunload",function(){localStorage.setItem("menu.scrollTop",e.scrollTop)}),e.scrollTop=localStorage.getItem("menu.scrollTop")})()</script>



  </div>
</aside>
 

    <div class="book-page">
      <header class="book-header">
        
  <div class="flex align-center justify-between">
  <label for="menu-control">
    <img src="/svg/menu.svg" class="book-icon" alt="Menu" />
  </label>

  <h3>gpt文生图</h3>

  <label for="toc-control">
    
    <img src="/svg/toc.svg" class="book-icon" alt="Table of Contents" />
    
  </label>
</div>


  
  <aside class="hidden clearfix">
    
  
<nav id="TableOfContents">
  <ul>
    <li><a href="#gpt文生图">gpt文生图</a>
      <ul>
        <li><a href="#概念介绍"><strong>概念介绍</strong></a></li>
        <li><a href="#基础信息"><strong>基础信息</strong></a></li>
        <li><a href="#请求参数"><strong>请求参数</strong></a></li>
        <li><a href="#支持的模型"><strong>支持的模型</strong></a></li>
        <li><a href="#python调用示例"><strong>Python调用示例</strong></a></li>
        <li><a href="#响应示例"><strong>响应示例</strong></a></li>
        <li><a href="#常见错误码"><strong>常见错误码：</strong></a></li>
        <li><a href="#详细教程神马中转"><strong>详细教程</strong>神马中转</a>
          <ul>
            <li><a href="#-神马中转api-2025超强画图模型天团驾到"><strong>🎨 神马中转API 2025超强画图模型天团驾到！</strong></a></li>
            <li><a href="#-模型天团简历2025顶配版"><strong>🌟 模型天团简历（2025顶配版）</strong></a></li>
            <li><a href="#-上车指南"><strong>🚀 上车指南</strong></a></li>
            <li><a href="#-模特aseedream-30文生图小旋风"><strong>💫 模特A：seedream-3.0（文生图小旋风）</strong></a></li>
            <li><a href="#-模特bgpt-image-1ps战神"><strong>🎩 模特B：gpt-image-1（PS战神）</strong></a></li>
            <li><a href="#-模特cflux-kontext商业级精修大师"><strong>🌟 模特C：flux-kontext（商业级精修大师）</strong></a></li>
            <li><a href="#-真爱提示"><strong>❤️ 真爱提示</strong></a></li>
            <li><a href="#-毕业典礼--防坑指南"><strong>🎉 毕业典礼 &amp; 防坑指南</strong></a></li>
          </ul>
        </li>
      </ul>
    </li>
  </ul>
</nav>



  </aside>
  
 
      </header>

      
      
  <article class="markdown book-article"><h1 id="gpt文生图">
  gpt文生图
  
  <a class="anchor" href="#gpt%e6%96%87%e7%94%9f%e5%9b%be">#</a>
  
</h1>
<h2 id="概念介绍">
  <strong>概念介绍</strong>
  
  <a class="anchor" href="#%e6%a6%82%e5%bf%b5%e4%bb%8b%e7%bb%8d">#</a>
  
</h2>
<hr>
<p>文生图(Text-to-Image)是一种通过自然语言描述生成对应图像的技术。本API基于OpenAI的GPT模型实现，支持多种图像生成模型和尺寸规格。</p>
<h2 id="基础信息">
  <strong>基础信息</strong>
  
  <a class="anchor" href="#%e5%9f%ba%e7%a1%80%e4%bf%a1%e6%81%af">#</a>
  
</h2>
<hr>
<ul>
<li>
<p>请求方式: POST</p>
</li>
<li>
<p>Base URL: <code>https://api.whatai.cc</code></p>
</li>
<li>
<p>接口路径: <code>/v1/images/generations</code></p>
</li>
<li>
<p>认证方式: Bearer Token</p>
</li>
</ul>
<h2 id="请求参数">
  <strong>请求参数</strong>
  
  <a class="anchor" href="#%e8%af%b7%e6%b1%82%e5%8f%82%e6%95%b0">#</a>
  
</h2>
<hr>
<table>
  <thead>
      <tr>
          <th><strong>参数名</strong></th>
          <th><strong>类型</strong></th>
          <th><strong>必填</strong></th>
          <th><strong>说明</strong></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>prompt</td>
          <td>string</td>
          <td>是</td>
          <td>图像描述文本</td>
      </tr>
      <tr>
          <td>n</td>
          <td>int</td>
          <td>否</td>
          <td>生成图片数量(默认1)</td>
      </tr>
      <tr>
          <td>model</td>
          <td>string</td>
          <td>否</td>
          <td>模型选择(默认gpt-image-1)</td>
      </tr>
      <tr>
          <td>aspect_ratio</td>
          <td>string</td>
          <td>否</td>
          <td>宽高比(如&quot;16:9&quot;)</td>
      </tr>
      <tr>
          <td>size</td>
          <td>string</td>
          <td>否</td>
          <td>图像尺寸(如&quot;1024x1536&quot;)</td>
      </tr>
      <tr>
          <td>seed</td>
          <td>int</td>
          <td>否</td>
          <td>随机种子(-1表示随机)</td>
      </tr>
  </tbody>
</table>
<h2 id="支持的模型">
  <strong>支持的模型</strong>
  
  <a class="anchor" href="#%e6%94%af%e6%8c%81%e7%9a%84%e6%a8%a1%e5%9e%8b">#</a>
  
</h2>
<hr>
<ul>
<li>
<p><code>gpt-image-1</code>: 基础模型(支持1024x1024,1024x1536,1536x1024)</p>
</li>
<li>
<p><code>seedream-3.0</code>: 国内最强，豆包团队开发，即梦3 AI绘图大模型。</p>
</li>
<li>
<p><code>gpt-image-1</code>: Openai GPT 的画图模型，文本理解与图像生成深度融合，适合文字驱动型创作</p>
</li>
<li>
<p><code>imagen4</code>: 谷歌的绘图模型，对标 gpt-image</p>
</li>
<li>
<p><code>flux-kontext-max</code>: Black Forest Labs推出商业级精度的图像生成，满足专业设计需求</p>
</li>
<li>
<p><code>flux-kontext-pro</code>: 支持文本+图像输入的上下文感知生成/编辑模型，控制更精准。</p>
</li>
</ul>
<h2 id="python调用示例">
  <strong>Python调用示例</strong>
  
  <a class="anchor" href="#python%e8%b0%83%e7%94%a8%e7%a4%ba%e4%be%8b">#</a>
  
</h2>
<hr>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> json
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> requests
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># API配置</span>
</span></span><span style="display:flex;"><span>API_KEY <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;sk-********************&#34;</span>  <span style="color:#75715e"># 替换为你的API密钥</span>
</span></span><span style="display:flex;"><span>API_URL <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;https://api.whatai.cc/v1/images/generations&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># 请求参数</span>
</span></span><span style="display:flex;"><span>payload <span style="color:#f92672">=</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;prompt&#34;</span>: <span style="color:#e6db74">&#34;哪吒竖着大拇指，背景广告牌写着 API&#34;</span>,  <span style="color:#75715e"># 图像描述</span>
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;n&#34;</span>: <span style="color:#ae81ff">1</span>,  <span style="color:#75715e"># 生成数量 </span>
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;model&#34;</span>: <span style="color:#e6db74">&#34;gpt-image-1&#34;</span>,  <span style="color:#75715e"># 使用基础模型</span>
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;size&#34;</span>: <span style="color:#e6db74">&#34;1024x1536&#34;</span>,  <span style="color:#75715e"># 图像尺寸</span>
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;seed&#34;</span>: <span style="color:#f92672">-</span><span style="color:#ae81ff">1</span>  <span style="color:#75715e"># -1 代表随机种子</span>
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>headers <span style="color:#f92672">=</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;Authorization&#34;</span>: <span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;Bearer </span><span style="color:#e6db74">{</span>API_KEY<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;Content-Type&#34;</span>: <span style="color:#e6db74">&#34;application/json&#34;</span>
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">try</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># 发送POST请求</span>
</span></span><span style="display:flex;"><span>    response <span style="color:#f92672">=</span> requests<span style="color:#f92672">.</span>post(API_URL, json<span style="color:#f92672">=</span>payload, headers<span style="color:#f92672">=</span>headers)
</span></span><span style="display:flex;"><span>    response<span style="color:#f92672">.</span>raise_for_status()  <span style="color:#75715e"># 检查HTTP错误</span>
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># 解析响应数据</span>
</span></span><span style="display:flex;"><span>    result <span style="color:#f92672">=</span> response<span style="color:#f92672">.</span>json()
</span></span><span style="display:flex;"><span>    print(json<span style="color:#f92672">.</span>dumps(result, indent<span style="color:#f92672">=</span><span style="color:#ae81ff">4</span>, ensure_ascii<span style="color:#f92672">=</span><span style="color:#66d9ef">False</span>))
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">except</span> requests<span style="color:#f92672">.</span>exceptions<span style="color:#f92672">.</span>RequestException <span style="color:#66d9ef">as</span> e:
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># 错误处理</span>
</span></span><span style="display:flex;"><span>    print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;请求失败: </span><span style="color:#e6db74">{</span>e<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> e<span style="color:#f92672">.</span>response:
</span></span><span style="display:flex;"><span>        print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;状态码: </span><span style="color:#e6db74">{</span>e<span style="color:#f92672">.</span>response<span style="color:#f92672">.</span>status_code<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span><span style="display:flex;"><span>        print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;响应内容: </span><span style="color:#e6db74">{</span>e<span style="color:#f92672">.</span>response<span style="color:#f92672">.</span>text<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span></code></pre></div><h2 id="响应示例">
  <strong>响应示例</strong>
  
  <a class="anchor" href="#%e5%93%8d%e5%ba%94%e7%a4%ba%e4%be%8b">#</a>
  
</h2>
<hr>
<p>图片返回<code>base64</code>需要转为png图片格式。</p>
<p>成功响应将返回包含生成图像信息的JSON对象，其中可能包含：</p>
<ul>
<li>
<p><code>data</code>: 图像数据数组</p>
</li>
<li>
<p><code>url</code>: 图像访问URL(部分模型)</p>
</li>
<li>
<p><code>b64_json</code>: Base64编码的图像数据</p>
</li>
</ul>
<pre tabindex="0"><code>{
    &#34;created&#34;: 1677664795,
    &#34;data&#34;: [
        {
            &#34;url&#34;: &#34;https://.../generated-image.png&#34;,
            &#34;b64_json&#34;: &#34;...&#34; 
        }
    ]
}
</code></pre><h2 id="常见错误码">
  <strong>常见错误码：</strong>
  
  <a class="anchor" href="#%e5%b8%b8%e8%a7%81%e9%94%99%e8%af%af%e7%a0%81">#</a>
  
</h2>
<hr>
<ul>
<li>
<p>401: 认证失败(无效API密钥)</p>
</li>
<li>
<p>400: 请求参数错误</p>
</li>
<li>
<p>429: 请求频率限制</p>
</li>
<li>
<p>500: 服务器内部错误</p>
</li>
</ul>
<p>建议在代码中添加完善的错误处理逻辑，如示例中所示。</p>
<h2 id="详细教程神马中转">
  <strong>详细教程</strong>神马中转
  
  <a class="anchor" href="#%e8%af%a6%e7%bb%86%e6%95%99%e7%a8%8b%e7%a5%9e%e9%a9%ac%e4%b8%ad%e8%bd%ac">#</a>
  
</h2>
<hr>
<h3 id="-神马中转api-2025超强画图模型天团驾到">
  <strong>🎨 神马中转API 2025超强画图模型天团驾到！</strong>
  
  <a class="anchor" href="#-%e7%a5%9e%e9%a9%ac%e4%b8%ad%e8%bd%acapi-2025%e8%b6%85%e5%bc%ba%e7%94%bb%e5%9b%be%e6%a8%a1%e5%9e%8b%e5%a4%a9%e5%9b%a2%e9%a9%be%e5%88%b0">#</a>
  
</h3>

<blockquote class='book-hint '>
  <p>&ldquo;不会画画的API不是好艺术家&rdquo; - <strong>神马中转API</strong>用户如是说</p>
</blockquote><p>欢迎来到《手把手教你玩转AI画图》！这里有一群身怀绝技的&quot;数字达芬奇&quot;，随你调遣~</p>
<hr>
<h3 id="-模型天团简历2025顶配版">
  <strong>🌟 模型天团简历（2025顶配版）</strong>
  
  <a class="anchor" href="#-%e6%a8%a1%e5%9e%8b%e5%a4%a9%e5%9b%a2%e7%ae%80%e5%8e%862025%e9%a1%b6%e9%85%8d%e7%89%88">#</a>
  
</h3>
<table>
  <thead>
      <tr>
          <th><strong>模特名</strong></th>
          <th><strong>后台大佬</strong></th>
          <th><strong>必杀技</strong></th>
          <th><strong>身价（每张）</strong></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>seedream-3.0</strong></td>
          <td>字节跳动豆包</td>
          <td>文生图闪电侠⚡️</td>
          <td>￥0.08 (~免费10万张!)</td>
      </tr>
      <tr>
          <td><strong>gpt-image-1</strong></td>
          <td>OpenAI</td>
          <td>改图/合图魔术师🎩</td>
          <td>￥1+</td>
      </tr>
      <tr>
          <td><strong>imagen4</strong></td>
          <td>谷歌</td>
          <td>GPT-image的宿敌👊</td>
          <td>待定</td>
      </tr>
      <tr>
          <td><strong>flux-kontext</strong></td>
          <td>Black Forest</td>
          <td>商业级精修大师🖋️</td>
          <td>￥0.2~0.4</td>
      </tr>
  </tbody>
</table>

<blockquote class='book-hint '>
  <p>📌 <strong>温馨提示</strong>：</p>
<p>不同模特在不同场景表现迥异，建议多约会试试~（比如seedream适合批量创作，gpt-image擅长精修）</p>
</blockquote><h3 id="-上车指南">
  <strong>🚀 上车指南</strong>
  
  <a class="anchor" href="#-%e4%b8%8a%e8%bd%a6%e6%8c%87%e5%8d%97">#</a>
  
</h3>
<p>1️⃣ <strong>领钥匙</strong>：在 <a href="https://api.whatai.cc/token">https://api.whatai.cc/token</a> 获取API密钥</p>
<p>2️⃣ <strong>选车站</strong>：</p>
<pre tabindex="0"><code>API_HOST = &#34;api.whatai.cc&#34;
</code></pre><h3 id="-模特aseedream-30文生图小旋风">
  <strong>💫 模特A：seedream-3.0（文生图小旋风）</strong>
  
  <a class="anchor" href="#-%e6%a8%a1%e7%89%b9aseedream-30%e6%96%87%e7%94%9f%e5%9b%be%e5%b0%8f%e6%97%8b%e9%a3%8e">#</a>
  
</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> base64<span style="color:#f92672">,</span> http.client<span style="color:#f92672">,</span> json<span style="color:#f92672">,</span> os<span style="color:#f92672">,</span> time
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># 配置你的魔法棒🔮</span>
</span></span><span style="display:flex;"><span>API_KEY <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;sk-******&#34;</span>  <span style="color:#75715e"># 此处填你的阿拉丁神灯密码</span>
</span></span><span style="display:flex;"><span>prompt <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;漫画风格英语学习图：Hello单词记忆引导&#34;</span>  <span style="color:#75715e"># 你的脑洞有多大，舞台就有多大！</span>
</span></span><span style="display:flex;"><span>size <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;1664x936&#34;</span>  <span style="color:#75715e"># 常用尺寸任选：16:9(宽屏) | 1:1(Ins风) | 9:16(手机壁纸)</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># 开始召唤！</span>
</span></span><span style="display:flex;"><span>conn <span style="color:#f92672">=</span> http<span style="color:#f92672">.</span>client<span style="color:#f92672">.</span>HTTPSConnection(<span style="color:#e6db74">&#34;api.whatai.cc&#34;</span>)
</span></span><span style="display:flex;"><span>conn<span style="color:#f92672">.</span>request(<span style="color:#e6db74">&#34;POST&#34;</span>, <span style="color:#e6db74">&#34;/v1/images/generations&#34;</span>, json<span style="color:#f92672">.</span>dumps({
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;prompt&#34;</span>: prompt,
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;model&#34;</span>: <span style="color:#e6db74">&#34;seedream-3.0&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;size&#34;</span>: size,
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;response_format&#34;</span>: <span style="color:#e6db74">&#34;b64_json&#34;</span>  <span style="color:#75715e"># 必选！否则收不到图片快递</span>
</span></span><span style="display:flex;"><span>}), headers<span style="color:#f92672">=</span>{<span style="color:#e6db74">&#34;Authorization&#34;</span>: <span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;Bearer </span><span style="color:#e6db74">{</span>API_KEY<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>})
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># 拆快递啦~</span>
</span></span><span style="display:flex;"><span>res <span style="color:#f92672">=</span> conn<span style="color:#f92672">.</span>getresponse()
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">if</span> res<span style="color:#f92672">.</span>status <span style="color:#f92672">==</span> <span style="color:#ae81ff">200</span>:
</span></span><span style="display:flex;"><span>    img_data <span style="color:#f92672">=</span> json<span style="color:#f92672">.</span>loads(res<span style="color:#f92672">.</span>read())[<span style="color:#e6db74">&#34;data&#34;</span>][<span style="color:#ae81ff">0</span>][<span style="color:#e6db74">&#34;b64_json&#34;</span>]
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">with</span> open(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;seedream_</span><span style="color:#e6db74">{</span>int(time<span style="color:#f92672">.</span>time())<span style="color:#e6db74">}</span><span style="color:#e6db74">.png&#34;</span>, <span style="color:#e6db74">&#34;wb&#34;</span>) <span style="color:#66d9ef">as</span> f:
</span></span><span style="display:flex;"><span>        f<span style="color:#f92672">.</span>write(base64<span style="color:#f92672">.</span>b64decode(img_data))
</span></span><span style="display:flex;"><span>    print(<span style="color:#e6db74">&#34;🎉 你的大作已空投到文件夹！&#34;</span>)
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">else</span>:
</span></span><span style="display:flex;"><span>    print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;❌ 模特罢工了：</span><span style="color:#e6db74">{</span>res<span style="color:#f92672">.</span>status<span style="color:#e6db74">}</span><span style="color:#e6db74"> </span><span style="color:#e6db74">{</span>res<span style="color:#f92672">.</span>reason<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span></code></pre></div>
<blockquote class='book-hint '>
  <p>💡 <strong>冷知识</strong>：当前免费额度能生成10万张图，够你把《蒙娜丽莎》画成表情包全集！</p>
</blockquote><h3 id="-模特bgpt-image-1ps战神">
  <strong>🎩 模特B：gpt-image-1（PS战神）</strong>
  
  <a class="anchor" href="#-%e6%a8%a1%e7%89%b9bgpt-image-1ps%e6%88%98%e7%a5%9e">#</a>
  
</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> requests
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># 准备整容手术台</span>
</span></span><span style="display:flex;"><span>api_key <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;sk-******&#34;</span>
</span></span><span style="display:flex;"><span>files <span style="color:#f92672">=</span> [
</span></span><span style="display:flex;"><span>    (<span style="color:#e6db74">&#34;image&#34;</span>, (<span style="color:#e6db74">&#34;原图.jpg&#34;</span>, open(<span style="color:#e6db74">&#34;哪吒.jpg&#34;</span>, <span style="color:#e6db74">&#34;rb&#34;</span>), <span style="color:#e6db74">&#34;image/jpeg&#34;</span>)),  <span style="color:#75715e"># 要改造的对象</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># (&#34;image&#34;, (&#34;背景.jpg&#34;, ...))  # 多图合并时加此项</span>
</span></span><span style="display:flex;"><span>]
</span></span><span style="display:flex;"><span>payload <span style="color:#f92672">=</span> {<span style="color:#e6db74">&#34;prompt&#34;</span>: <span style="color:#e6db74">&#34;给哪吒戴上炫酷红色鸭舌帽&#34;</span>}  <span style="color:#75715e"># 你的改造指令</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># 开始施法！</span>
</span></span><span style="display:flex;"><span>r <span style="color:#f92672">=</span> requests<span style="color:#f92672">.</span>post(
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;https://api.whatai.cc/v1/images/edits&#34;</span>,
</span></span><span style="display:flex;"><span>    headers<span style="color:#f92672">=</span>{<span style="color:#e6db74">&#34;Authorization&#34;</span>: <span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;Bearer </span><span style="color:#e6db74">{</span>api_key<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>},
</span></span><span style="display:flex;"><span>    files<span style="color:#f92672">=</span>files,
</span></span><span style="display:flex;"><span>    data<span style="color:#f92672">=</span>payload
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># 见证奇迹时刻✨</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">if</span> r<span style="color:#f92672">.</span>status_code <span style="color:#f92672">==</span> <span style="color:#ae81ff">200</span>:
</span></span><span style="display:flex;"><span>    img_data <span style="color:#f92672">=</span> r<span style="color:#f92672">.</span>json()[<span style="color:#e6db74">&#34;data&#34;</span>][<span style="color:#ae81ff">0</span>][<span style="color:#e6db74">&#34;b64_json&#34;</span>]
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">with</span> open(<span style="color:#e6db74">&#34;潮酷哪吒.png&#34;</span>, <span style="color:#e6db74">&#34;wb&#34;</span>) <span style="color:#66d9ef">as</span> f:
</span></span><span style="display:flex;"><span>        f<span style="color:#f92672">.</span>write(base64<span style="color:#f92672">.</span>b64decode(img_data))
</span></span><span style="display:flex;"><span>    print(
</span></span></code></pre></div><h3 id="-模特cflux-kontext商业级精修大师">
  <strong>🌟 模特C：flux-kontext（商业级精修大师）</strong>
  
  <a class="anchor" href="#-%e6%a8%a1%e7%89%b9cflux-kontext%e5%95%86%e4%b8%9a%e7%ba%a7%e7%b2%be%e4%bf%ae%e5%a4%a7%e5%b8%88">#</a>
  
</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> requests
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> os
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> base64
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> time <span style="color:#f92672">import</span> sleep
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># 准备你的魔法工具箱🛠️</span>
</span></span><span style="display:flex;"><span>API_KEY <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;sk-******&#34;</span>  <span style="color:#75715e"># 你的专属魔法通行证</span>
</span></span><span style="display:flex;"><span>target_img <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;沙漠.jpg&#34;</span>  <span style="color:#75715e"># 需要点石成金的照片</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>print(<span style="color:#e6db74">&#34;🔮 正在召唤商业级修图精灵flux-kontext...&#34;</span>)
</span></span><span style="display:flex;"><span>sleep(<span style="color:#ae81ff">1</span>)  <span style="color:#75715e"># 加点魔法特效等待时间</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">try</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># 开始施展专业级图像魔法</span>
</span></span><span style="display:flex;"><span>    response <span style="color:#f92672">=</span> requests<span style="color:#f92672">.</span>post(
</span></span><span style="display:flex;"><span>        <span style="color:#e6db74">&#34;https://api.whatai.cc/v1/images/edits&#34;</span>,  <span style="color:#75715e"># 国际站小伙伴请用.com</span>
</span></span><span style="display:flex;"><span>        headers<span style="color:#f92672">=</span>{<span style="color:#e6db74">&#34;Authorization&#34;</span>: <span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;Bearer </span><span style="color:#e6db74">{</span>API_KEY<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>},
</span></span><span style="display:flex;"><span>        files<span style="color:#f92672">=</span>[(<span style="color:#e6db74">&#34;image[]&#34;</span>, (os<span style="color:#f92672">.</span>path<span style="color:#f92672">.</span>basename(target_img), open(target_img, <span style="color:#e6db74">&#34;rb&#34;</span>), <span style="color:#e6db74">&#34;image/jpeg&#34;</span>))],
</span></span><span style="display:flex;"><span>        data<span style="color:#f92672">=</span>{
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;model&#34;</span>: <span style="color:#e6db74">&#34;flux-kontext-max&#34;</span>,  <span style="color:#75715e"># 可选：flux-kontext-pro（速度型）｜ flux-kontext-max（质量型）</span>
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;prompt&#34;</span>: <span style="color:#e6db74">&#34;给沙漠照片添加绿洲和彩虹&#34;</span>,  <span style="color:#75715e"># 你的想象力是唯一的限制</span>
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;quality&#34;</span>: <span style="color:#e6db74">&#34;high&#34;</span>  <span style="color:#75715e"># 品质选项：low（快但糙）｜ medium｜ high（慢但精）</span>
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    )
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># 检查魔法是否生效</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> response<span style="color:#f92672">.</span>status_code <span style="color:#f92672">==</span> <span style="color:#ae81ff">200</span>:
</span></span><span style="display:flex;"><span>        print(<span style="color:#e6db74">&#34;🌈 魔法生效中...专业精灵正在精修您的照片&#34;</span>)
</span></span><span style="display:flex;"><span>        img_data <span style="color:#f92672">=</span> response<span style="color:#f92672">.</span>json()[<span style="color:#e6db74">&#34;data&#34;</span>][<span style="color:#ae81ff">0</span>][<span style="color:#e6db74">&#34;b64_json&#34;</span>]
</span></span><span style="display:flex;"><span>        
</span></span><span style="display:flex;"><span>        <span style="color:#75715e"># 保存你的魔法杰作</span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">with</span> open(<span style="color:#e6db74">&#34;沙漠奇迹.jpg&#34;</span>, <span style="color:#e6db74">&#34;wb&#34;</span>) <span style="color:#66d9ef">as</span> f:
</span></span><span style="display:flex;"><span>            f<span style="color:#f92672">.</span>write(base64<span style="color:#f92672">.</span>b64decode(img_data))
</span></span><span style="display:flex;"><span>        print(<span style="color:#e6db74">&#34;🎨 专业级大片已生成！建议立即设为壁纸炫耀~&#34;</span>)
</span></span><span style="display:flex;"><span>        
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">else</span>:
</span></span><span style="display:flex;"><span>        print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;🧙‍♂️ 啊哦，魔法失灵了！错误代码：</span><span style="color:#e6db74">{</span>response<span style="color:#f92672">.</span>status_code<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span><span style="display:flex;"><span>        print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;🔍 详细原因：</span><span style="color:#e6db74">{</span>response<span style="color:#f92672">.</span>text[:<span style="color:#ae81ff">100</span>]<span style="color:#e6db74">}</span><span style="color:#e6db74">...&#34;</span>)  <span style="color:#75715e"># 显示部分错误信息</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">except</span> <span style="color:#a6e22e">Exception</span> <span style="color:#66d9ef">as</span> e:
</span></span><span style="display:flex;"><span>    print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;⚠️ 魔法反噬警告：</span><span style="color:#e6db74">{</span>str(e)<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span><span style="display:flex;"><span>    print(<span style="color:#e6db74">&#34;💡 小贴士：检查图片路径 | 网络连接 | API密钥有效性&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">finally</span>:
</span></span><span style="display:flex;"><span>    print(<span style="color:#e6db74">&#34;✨ 本次魔法仪式结束，期待您下次召唤！&#34;</span>)
</span></span></code></pre></div>
<blockquote class='book-hint '>
  <p><strong>专业小贴士</strong>：</p>
<ol>
<li>
<p><code>flux-kontext-pro</code>和<code>flux-kontext-max</code>就像魔法学徒和魔法大师——前者快，后者强</p>
</li>
<li>
<p>遇到复杂魔法（大图精修）时，喝杯咖啡耐心等待☕️</p>
</li>
<li>
<p><code>quality</code>参数是质量与速度的平衡术，按需调配</p>
</li>
</ol>
</blockquote><h3 id="-真爱提示">
  <strong>❤️ 真爱提示</strong>
  
  <a class="anchor" href="#-%e7%9c%9f%e7%88%b1%e6%8f%90%e7%a4%ba">#</a>
  
</h3>
<ol>
<li>
<p><strong>密钥保管</strong>：千万别把<code>sk-***</code>发到网上，否则你的AI模特会被别人拐跑！</p>
</li>
<li>
<p><strong>错误处理</strong>：遇到错误先检查——</p>
</li>
</ol>
<ul>
<li>
<p>✔️ 域名写对了吗？</p>
</li>
<li>
<p>✔️ 图片路径正确吗？</p>
</li>
<li>
<p>✔️ 免费额度用完啦？</p>
</li>
</ul>
<ol>
<li><strong>玩得开心</strong>：多尝试不同咒语(prompt)，你会打开新世界大门！</li>
</ol>

<blockquote class='book-hint '>
  <p>最后，神马中转API团队为你打Call：&ldquo;让每个创意都轻松落地，是我们不变的初心~ ✨&rdquo;</p>
</blockquote><h3 id="-毕业典礼--防坑指南">
  <strong>🎉 毕业典礼 &amp; 防坑指南</strong>
  
  <a class="anchor" href="#-%e6%af%95%e4%b8%9a%e5%85%b8%e7%a4%bc--%e9%98%b2%e5%9d%91%e6%8c%87%e5%8d%97">#</a>
  
</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#75715e"># 所有模特通用的生存法则</span>
</span></span><span style="display:flex;"><span>print(<span style="color:#e6db74">&#34;&#34;&#34;
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">🌟 三大黄金定律  🌟
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">1. 密钥保管好 -&gt; 别让sk-***出现在GitHub上！
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">2. 域名要选对 -&gt; .cn还是.com？错配会变404幽灵👻
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">3. 尺寸看清楚 -&gt; 别让16:9的美图硬塞进1:1相框！
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">&#34;&#34;&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>print(<span style="color:#e6db74">&#34;🎓 恭喜你完成AI画图大师课程！现在去征服世界吧~&#34;</span>)
</span></span></code></pre></div><p>✨ 教程到此结束，但你的创作之旅才刚刚开始！快去生成你的第一幅AI杰作吧~</p>
</article>
 
      

      <footer class="book-footer">
        
  <div class="flex flex-wrap justify-between">





</div>





  
  
  
  <div class="flex flex-wrap justify-between">
    <span>
    
      <a href="/docs/openai/gpttts/" class="flex align-center book-icon">
        <img src="/svg/backward.svg" class="book-icon" alt="Previous" title="gpt-tts" />
        <span>gpt-tts</span>
      </a>
    
    </span>
    <span>
    
      <a href="/docs/openai/gpttst/" class="flex align-center book-icon">
        <span>gpt图生图</span>
        <img src="/svg/forward.svg" class="book-icon" alt="Next" title="gpt图生图" />
      </a>
    
    </span>
  </div>
  




  <script>(function(){function e(e){const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}document.querySelectorAll("pre code").forEach(t=>{t.addEventListener("click",function(){if(window.getSelection().toString())return;e(t.parentElement),navigator.clipboard&&navigator.clipboard.writeText(t.parentElement.textContent)})})})()</script>


 
        
      </footer>

      
  
  <div class="book-comments">

</div>
  
 
      <label for="menu-control" class="hidden book-menu-overlay"></label>
    </div>

    

<aside class="book-toc">
  <div class="book-toc-content">
    
  
<nav id="TableOfContents">
  <ul>
    <li><a href="#gpt文生图">gpt文生图</a>
      <ul>
        <li><a href="#概念介绍"><strong>概念介绍</strong></a></li>
        <li><a href="#基础信息"><strong>基础信息</strong></a></li>
        <li><a href="#请求参数"><strong>请求参数</strong></a></li>
        <li><a href="#支持的模型"><strong>支持的模型</strong></a></li>
        <li><a href="#python调用示例"><strong>Python调用示例</strong></a></li>
        <li><a href="#响应示例"><strong>响应示例</strong></a></li>
        <li><a href="#常见错误码"><strong>常见错误码：</strong></a></li>
        <li><a href="#详细教程神马中转"><strong>详细教程</strong>神马中转</a>
          <ul>
            <li><a href="#-神马中转api-2025超强画图模型天团驾到"><strong>🎨 神马中转API 2025超强画图模型天团驾到！</strong></a></li>
            <li><a href="#-模型天团简历2025顶配版"><strong>🌟 模型天团简历（2025顶配版）</strong></a></li>
            <li><a href="#-上车指南"><strong>🚀 上车指南</strong></a></li>
            <li><a href="#-模特aseedream-30文生图小旋风"><strong>💫 模特A：seedream-3.0（文生图小旋风）</strong></a></li>
            <li><a href="#-模特bgpt-image-1ps战神"><strong>🎩 模特B：gpt-image-1（PS战神）</strong></a></li>
            <li><a href="#-模特cflux-kontext商业级精修大师"><strong>🌟 模特C：flux-kontext（商业级精修大师）</strong></a></li>
            <li><a href="#-真爱提示"><strong>❤️ 真爱提示</strong></a></li>
            <li><a href="#-毕业典礼--防坑指南"><strong>🎉 毕业典礼 &amp; 防坑指南</strong></a></li>
          </ul>
        </li>
      </ul>
    </li>
  </ul>
</nav>



  </div>
</aside>

 
  </main>

  
</body>
</html>
















